package mediator;

import java.util.ArrayList;
import java.util.HashMap;

public class Dictionnaire {

	private static HashMap<String, HashMap<String, ArrayList<String>>> dicObjet;

	public Dictionnaire() {
		super();
	}

	public static HashMap<String, HashMap<String, ArrayList<String>>> getdico() {

		if (dicObjet == null) {
			createDico();
		}
		return dicObjet;
	}

	@SuppressWarnings("unchecked")
	private static void createDico() {

		Dictionnaire.dicObjet = new HashMap<String, HashMap<String, ArrayList<String>>>();

		ArrayList<String> S1 = new ArrayList<String>();
		S1.add("S1");
		ArrayList<String> S2 = new ArrayList<String>();
		S2.add("S2");
		ArrayList<String> S3 = new ArrayList<String>();
		S3.add("S3");
		ArrayList<String> S1S2 = new ArrayList<String>();
		S1S2.add("S1");
		S1S2.add("S2");
		ArrayList<String> S1S3 = new ArrayList<String>();
		S1S3.add("S1");
		S1S3.add("S3");
		ArrayList<String> S2S3 = new ArrayList<String>();
		S2S3.add("S2");
		S2S3.add("S3");
		ArrayList<String> S1S2S3 = new ArrayList<String>();
		S1S2S3.add("S1");
		S1S2S3.add("S2");
		S1S2S3.add("S3");

		HashMap<String, ArrayList<String>> fields = new HashMap<String, ArrayList<String>>();

		fields.put("ID-Etudiant", S2S3);
		fields.put("Nom", S2S3);
		fields.put("Prenom", S2);
		fields.put("FormationPrecedente", S2S3);
		fields.put("PaysFormationPrecedente", S2S3);
		fields.put("AnneeDebut", S2S3);
		fields.put("NiveauInsertiont", S2S3);
		fields.put("Age", S2S3);

		Dictionnaire.dicObjet.put("Etudiant",
				(HashMap<String, ArrayList<String>>) fields.clone());

		fields.clear();

		fields.put("ID-Enseignant", S2S3);
		fields.put("Nom", S2S3);
		fields.put("Prenom", S2S3);
		fields.put("adresseMail", S3);

		Dictionnaire.dicObjet.put("Enseignant",
				(HashMap<String, ArrayList<String>>) fields.clone());

		fields.clear();

		fields.put("ID-Cours", S2S3);
		fields.put("Libele", S2S3);
		fields.put("Type", S2S3);
		fields.put("Niveau", S2S3);
		fields.put("Heures", S3);

		Dictionnaire.dicObjet.put("Cours",
				(HashMap<String, ArrayList<String>>) fields.clone());

		fields.clear();

		fields.put("ID-Etudiant", S2S3);
		fields.put("ID-Cours", S2S3);
		fields.put("Annee", S2S3);
		fields.put("Note", S2S3);

		Dictionnaire.dicObjet.put("Inscription",
				(HashMap<String, ArrayList<String>>) fields.clone());

		fields.clear();

		fields.put("ID-Cours", S2S3);
		fields.put("ID-Enseignant", S2S3);
		fields.put("Annee", S2S3);
		fields.put("Heures", S3);

		Dictionnaire.dicObjet.put("Enseigne",
				(HashMap<String, ArrayList<String>>) fields.clone());
	}
}
